#include <tinyhal.h>

#define USE_WEAR_LEVELING

extern struct BlockStorageDevice  g_FM4_BS;
extern struct IBlockStorageDevice g_FM4_Flash_DeviceTable;
extern struct BLOCK_CONFIG        g_FM4_BS_Config;

extern struct BlockStorageDevice  g_TC58NVG3S0F_BS;
#ifdef USE_WEAR_LEVELING
extern struct IBlockStorageDevice g_BS_WearLeveling_DeviceTable;
extern struct BLOCK_CONFIG        g_TC58NVG3S0F_WearLeveling_Config;
#else
extern struct IBlockStorageDevice g_NandFlash_BL_DeviceTable;       // g_TC58NVG3S0F_BS_DeviceTable
extern struct BLOCK_CONFIG        g_TC58NVG3S0F_BS_Config;
#endif

void BlockStorage_AddDevices()
{
    BlockStorageList::AddDevice(&g_FM4_BS,
                                &g_FM4_Flash_DeviceTable,
                                &g_FM4_BS_Config, FALSE);
#if defined(ENABLE_NAND)
#if defined(USE_WEAR_LEVELING)
    BlockStorageList::AddDevice(&g_TC58NVG3S0F_BS,
                                &g_BS_WearLeveling_DeviceTable,
                                &g_TC58NVG3S0F_WearLeveling_Config, FALSE);
#else
	BlockStorageList::AddDevice(&g_TC58NVG3S0F_BS,
	                            &g_NandFlash_BL_DeviceTable,      // g_TC58NVG3S0F_BS_DeviceTable
	                            &g_TC58NVG3S0F_BS_Config, FALSE);
#endif
#endif
}

